<?php
/**
 * Created by PhpStorm.
 * User: gogo
 * Date: 2019/2/22
 * Time: 下午5:33
 */
namespace app\model;


class RepairPerson extends BaseModel
{
    static function createOrUpdate($data = [])
    {
        $id = self::where(['customer_id'=> $data['customer_id']])->value('id');
        if($id)
        {
            self::where(['id'=> $id])->update($data);
        }else{
            $id = self::insertGetId($data);
        }

        return $id;
    }
}